Optimal. Leaf size=85 \[ \frac {1}{16} \sqrt {\pi } C\left (\frac {2 x+1}{\sqrt {\pi }}\right )-\frac {1}{16} \sqrt {\pi } S\left (\frac {2 x+1}{\sqrt {\pi }}\right )+\frac {x^3}{6}+\frac {1}{8} x \sin \left (2 x^2+2 x+\frac {1}{2}\right )-\frac {1}{16} \sin \left (2 x^2+2 x+\frac {1}{2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.467, Rules used = {3468, 3464, 3445, 3351, 3462, 3446, 3352} \[ \frac {1}{16} \sqrt {\pi } \text {FresnelC}\left (\frac {2 x+1}{\sqrt {\pi }}\right )-\frac {1}{16} \sqrt {\pi } S\left (\frac {2 x+1}{\sqrt {\pi }}\right )+\frac {x^3}{6}+\frac {1}{8} x \sin \left (2 x^2+2 x+\frac {1}{2}\right )-\frac {1}{16} \sin \left (2 x^2+2 x+\frac {1}{2}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3351
Rule 3352
Rule 3445
Rule 3446
Rule 3462
Rule 3464
Rule 3468
Rubi steps
\begin {align*} \int x^2 \cos ^2\left (\frac {1}{4}+x+x^2\right ) \, dx &=\int \left (\frac {x^2}{2}+\frac {1}{2} x^2 \cos \left (\frac {1}{2}+2 x+2 x^2\right )\right ) \, dx\\ &=\frac {x^3}{6}+\frac {1}{2} \int x^2 \cos \left (\frac {1}{2}+2 x+2 x^2\right ) \, dx\\ &=\frac {x^3}{6}+\frac {1}{8} x \sin \left (\frac {1}{2}+2 x+2 x^2\right )-\frac {1}{8} \int \sin \left (\frac {1}{2}+2 x+2 x^2\right ) \, dx-\frac {1}{4} \int x \cos \left (\frac {1}{2}+2 x+2 x^2\right ) \, dx\\ &=\frac {x^3}{6}-\frac {1}{16} \sin \left (\frac {1}{2}+2 x+2 x^2\right )+\frac {1}{8} x \sin \left (\frac {1}{2}+2 x+2 x^2\right )+\frac {1}{8} \int \cos \left (\frac {1}{2}+2 x+2 x^2\right ) \, dx-\frac {1}{8} \int \sin \left (\frac {1}{8} (2+4 x)^2\right ) \, dx\\ &=\frac {x^3}{6}-\frac {1}{16} \sqrt {\pi } S\left (\frac {1+2 x}{\sqrt {\pi }}\right )-\frac {1}{16} \sin \left (\frac {1}{2}+2 x+2 x^2\right )+\frac {1}{8} x \sin \left (\frac {1}{2}+2 x+2 x^2\right )+\frac {1}{8} \int \cos \left (\frac {1}{8} (2+4 x)^2\right ) \, dx\\ &=\frac {x^3}{6}+\frac {1}{16} \sqrt {\pi } C\left (\frac {1+2 x}{\sqrt {\pi }}\right )-\frac {1}{16} \sqrt {\pi } S\left (\frac {1+2 x}{\sqrt {\pi }}\right )-\frac {1}{16} \sin \left (\frac {1}{2}+2 x+2 x^2\right )+\frac {1}{8} x \sin \left (\frac {1}{2}+2 x+2 x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.15, size = 77, normalized size = 0.91 \[ \frac {1}{48} \left (3 \sqrt {\pi } C\left (\frac {2 x+1}{\sqrt {\pi }}\right )-3 \sqrt {\pi } S\left (\frac {2 x+1}{\sqrt {\pi }}\right )+8 x^3+6 x \sin \left (\frac {1}{2} (2 x+1)^2\right )-3 \sin \left (\frac {1}{2} (2 x+1)^2\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.81, size = 57, normalized size = 0.67 \[ \frac {1}{6} \, x^{3} + \frac {1}{8} \, {\left (2 \, x - 1\right )} \cos \left (x^{2} + x + \frac {1}{4}\right ) \sin \left (x^{2} + x + \frac {1}{4}\right ) + \frac {1}{16} \, \sqrt {\pi } \operatorname {C}\left (\frac {2 \, x + 1}{\sqrt {\pi }}\right ) - \frac {1}{16} \, \sqrt {\pi } \operatorname {S}\left (\frac {2 \, x + 1}{\sqrt {\pi }}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [C] time = 1.35, size = 64, normalized size = 0.75 \[ \frac {1}{6} \, x^{3} - \frac {1}{32} \, {\left (2 i \, x - i\right )} e^{\left (2 i \, x^{2} + 2 i \, x + \frac {1}{2} i\right )} - \frac {1}{32} \, {\left (-2 i \, x + i\right )} e^{\left (-2 i \, x^{2} - 2 i \, x - \frac {1}{2} i\right )} - \frac {1}{32} i \, \sqrt {\pi } \operatorname {erf}\left (\left (i - 1\right ) \, x + \frac {1}{2} i - \frac {1}{2}\right ) + \frac {1}{32} i \, \sqrt {\pi } \operatorname {erf}\left (-\left (i + 1\right ) \, x - \frac {1}{2} i - \frac {1}{2}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.05, size = 64, normalized size = 0.75 \[ \frac {x^{3}}{6}-\frac {\sin \left (\frac {1}{2}+2 x +2 x^{2}\right )}{16}+\frac {x \sin \left (\frac {1}{2}+2 x +2 x^{2}\right )}{8}+\frac {\FresnelC \left (\frac {1+2 x}{\sqrt {\pi }}\right ) \sqrt {\pi }}{16}-\frac {\mathrm {S}\left (\frac {1+2 x}{\sqrt {\pi }}\right ) \sqrt {\pi }}{16} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 1.76, size = 169, normalized size = 1.99 \[ \frac {8192 \, x^{4} + 4096 \, x^{3} + x {\left (3072 i \, e^{\left (2 i \, x^{2} + 2 i \, x + \frac {1}{2} i\right )} - 3072 i \, e^{\left (-2 i \, x^{2} - 2 i \, x - \frac {1}{2} i\right )}\right )} + \sqrt {8 \, x^{2} + 8 \, x + 2} {\left (-\left (192 i - 192\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {2 i \, x^{2} + 2 i \, x + \frac {1}{2} i}\right ) - 1\right )} + \left (192 i + 192\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {-2 i \, x^{2} - 2 i \, x - \frac {1}{2} i}\right ) - 1\right )} + \left (384 i + 384\right ) \, \sqrt {2} \Gamma \left (\frac {3}{2}, 2 i \, x^{2} + 2 i \, x + \frac {1}{2} i\right ) - \left (384 i - 384\right ) \, \sqrt {2} \Gamma \left (\frac {3}{2}, -2 i \, x^{2} - 2 i \, x - \frac {1}{2} i\right )\right )} + 1536 i \, e^{\left (2 i \, x^{2} + 2 i \, x + \frac {1}{2} i\right )} - 1536 i \, e^{\left (-2 i \, x^{2} - 2 i \, x - \frac {1}{2} i\right )}}{24576 \, {\left (2 \, x + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int x^2\,{\cos \left (x^2+x+\frac {1}{4}\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x^{2} \cos ^{2}{\left (x^{2} + x + \frac {1}{4} \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________